<?php
namespace App\Api\Rules;

use App\Api\Repositories\User\UsersRepositories;
use Illuminate\Contracts\Validation\Rule;


class PayNumberVerify implements Rule{

    // 根据积分获取对应金额，如果没有则说明输入的积分有问题
    public function passes($attribute, $value){
        $sys_setting_repositories = new \App\Api\Repositories\Sys\SysSettingRepositories();
        $res = $sys_setting_repositories->get_money($value);
        return $res == -1 ? false : true;
    }

    public function message(){
        return "请选择指定的充值积分数量";
    }
}